//
// Created by Jisam on 2024/7/13.
//
#include <bits/stdc++.h>
#define PSI pair<string,int>
#define PII pair<int,int>
#define x first
#define y second
#define i64 long long
using namespace std;
const int N = 1e5 + 5;
void solve() {
    i64 ans = 1000000;
    int n;
    cin >> n ;
    string s;
    while(n --){
        cin >> s;
        if(s != "PERFECT"){
            ans --;
        }
    }
    if(ans == 1000000){
        cout << "MILLION Master\n";
    }else{
        cout << "NA Noob\n";
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T;cin >> T;while(T --)
        solve();
    return 0;
}